BIN=mytest
SRC=$(shell ls *.c)
OBJ=$(SRC:.c=.o)
CC=gcc
RM=rm -f

$(BIN):$(OBJ)
	#$(CC) $(OBJ) -o $(BIN)
	$(CC) $^ -o $@
%.o:%.c
	$(CC) -c $< -g

.PHONY:clean
clean:
	rm $(OBJ) $(BIN)



#$(BIN):$(OBJ)
#	gcc $(OBJ) -o $(BIN)
#$(OBJ):$(SRC)
#	gcc -c $(SRC) -o $(OBJ)
#
#.PHONY:clean
#clean:
#	$(RM) $(BIN) $(OBJ)


#mytest:mytest.o
#	gcc mytest.o -o mytest
#mytest.o:test.c
#	gcc -c test.c -o mytest.o
#
#.PHONY:clean
#clean:
#	rm -f *.o mytest



#mytest:mytest.o
#	gcc mytest.o -o mytest
#mytest.o:test.c
#	gcc -c test.c -o mytest.o
#
#.PHONY:clean
#	rm -f *.o mytest






#mytest:test.c
#	gcc test.c -o mytest
#
#.PHONY:clean
#clean:
#	rm -f mytest
#
